{% load static %}

<link rel="stylesheet" href="{% static 'polls/style.css' %}">
<div class="container">
    <form action="{% url 'polls:vote' question.id %}" method="post">
        {% csrf_token %}
        <fieldset>
            <legend><h1>{{ question.question_text }}</h1></legend>
            {% if error_message %}
                <p class="error-message"><strong>{{ error_message }}</strong></p>
            {% endif %}
            {% for choice in question.choice_set.all %}
                <div class="choice">
                    <input type="radio" name="choice" id="choice{{ forloop.counter }}" value="{{ choice.id }}">
                    <label for="choice{{ forloop.counter }}">{{ choice.choice_text }}</label>
                </div>
            {% endfor %}
        </fieldset>
        <div style="margin-top: 20px;">
            <input type="submit" value="投票" class="vote-button">
            <a href="{% url 'polls:index'%}" class="vote-link">返回投票列表</a>
        </div>
    </form>
</div>

<footer>
    <div class="footer-content">
        <div class="copyright">
            &copy; 2025 投票系统，保留所有权利。
        </div>
        <div class="footer-links">
            <a href="/">首页</a>
            <a href="/admin">管理后台</a>
            <a href="https://gitee.com/cdg6666/django">关于我们</a>
            <a href="https://gitee.com/cdg6666/django">联系方式</a>
        </div>
    </div>
</footer>
